{php $top_name="会员登陆";}{template "header.html", "/"}

<div class="page-container">
    <div class="page-content-wrapper">

        <div class="page-content bg-b">
            <div class="container ">


                        <!-- BEGIN LOGIN FORM -->
                        <form class="login-form" id="myform" action="" method="post">
                            <input type="hidden" name="back" value="{$back_url}">
                            <div class="form-group">
                                <label class="control-label visible-ie8 visible-ie9">会员名称</label>
                                <input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="会员名称" name="data[username]" />
                            </div>
                            <div class="form-group">
                                <label class="control-label visible-ie8 visible-ie9">登录密码</label>
                                <input class="form-control form-control-solid placeholder-no-fix" type="password" autocomplete="off" placeholder="登录密码" name="data[password]" />
                            </div>
                            {if $code}
                            <div class="form-group">
                                <div class="col-sm-6" style="padding-left:0;padding-right:0">
                                    <input class="form-control form-control-solid placeholder-no-fix" type="text" autocomplete="off" placeholder="验证码" name="code" />
                                </div>
                                <div class="col-sm-6">
                                    <img align="absmiddle" id="dr_code_img" style="cursor:pointer;" onclick="this.src='{dr_member_url('api/captcha', array('width' => 120, 'height' => 40))}&'+Math.random();" src="{dr_member_url('api/captcha', array('width' => 120, 'height' => 40))}" />
                                </div>
                            </div>
                            {/if}
                            <div class="form-actions">
                                <button type="button" onclick="dr_submit()" class="btn red  btn-block">登录</button>
                                <a href="{dr_member_url('register/index')}" class="btn default btn-block"> 注册账号 </a>
                                <label class="rememberme check">
                                    <input type="checkbox" name="data[auto]" value="1" checked="checked" />免登录 </label>
                                <a href="{dr_member_url('login/find')}" class="forget-password">找回密码</a>
                            </div>
                            <div class="login-options">
                                <ul class="social-icons">
                                    {cache name=oauth}
                                    <li>
                                        <a class="social-icon-color facebook" style="background: url({THEME_PATH}oauth/{$t.id}.png) no-repeat" href="javascript:;" onclick="window.location.href='{dr_member_url('api/oauth')}&id={$t.id}'">
                                        </a>
                                    </li>
                                    {/cache}
                                </ul>
                            </div>
                        </form>
                        <script type="text/javascript">
                            function dr_submit() {
                                var post = $("#myform").serialize();
                                $.ajax({type: "POST",dataType:"json", url: "{dr_now_url()}", data: post,
                                    success: function(data) {
                                        if (data.status) {
                                            dr_tips('登录成功，即将为您跳转....', 3, 1);
                                            setTimeout('window.location.href="'+data.backurl+'"', <?php echo $_GET['debug'] ? 999999: 2000;?>);
                                            var sync_url = data.syncurl;
                                            // 发送同步登录信息
                                            for(var i in sync_url){
                                                $.ajax({
                                                    type: "GET",
                                                    async: false,
                                                    url:sync_url[i],
                                                    dataType: "jsonp",
                                                    success: function(json){ },
                                                    error: function(){ }
                                                });
                                            }
                                        } else {
                                            $('#dr_code_img').click();
                                            dr_tips(data.code);
                                        }
                                    },
                                    error: function(HttpRequest, ajaxOptions, thrownError) {
                                        alert(HttpRequest.responseText);
                                    }
                                });
                            }
                        </script>


            </div>
        </div>

    </div>

</div>


{template "footer.html", "/"}